package com.rjpacket.MyUEnjoy.adapters;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.rjpacket.MyUEnjoy.fragments.LastFragment;
import com.rjpacket.MyUEnjoy.fragments.LoginInFragment;

/**
 * Created by aaa on 15-1-23.
 */
public class LoginInAdapter extends FragmentPagerAdapter {
    public LoginInAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = null;

        if(position == 3) {
            fragment = new LastFragment();
        }else{
            fragment = new LoginInFragment();
            Bundle bundle = new Bundle();
            bundle.putInt("position", position);
            fragment.setArguments(bundle);
        }


        return fragment;
    }

    @Override
    public int getCount() {
        return 4;
    }
}
